//index.js
//获取应用实例
var app = getApp();
Page({
  data: {
   'text':'<view>你好</view>',
   'user_info':{},
   'followNotiCount':0,
  },
   //下拉刷新
  onPullDownRefresh: function () {
 
     this.intData();

  },
  
  
  intData:function(){
   var that = this;
   app.api("user/info", {}, function (res) {
     wx.stopPullDownRefresh();
     if (res.code != 200) {
       app.alert(res.msg);
       return;
     }
     that.setData({ user_info: res.data, followNotiCount: res.data.newFollow});
   })   
  },
  clearNewthumbs:function(){
    var user_info = this.data.user_info;
    user_info.newthumbs = 0;
    this.setData({ user_info: user_info });
  },
  clearNewFollow:function(){
    var user_info = this.data.user_info;
    user_info.newFollow = 0;
    this.setData({ user_info: user_info});
  },
  clearNoti:function(){
    var user_info = this.data.user_info;
    user_info.allNoti=0;
    user_info.newNoti = 0;
    this.setData({ user_info: user_info });
  },
  onLoad: function () {
    var that = this;
    this.intData();
    app.clearRedDot();
    
  },
  jumpToIndex:function(e){
    return;
    var showOrder = e.currentTarget.dataset.id;
    app.setPageData("user/timeline", { showTab: 0 });
   // console.log(showOrder);
    app.setPageData("user/timeline", { showOrder: showOrder  }  );
     wx.switchTab({
       url:'/pages/user/timeline'
     })
     
  }
})
